// this variable is used for onclick 

// js array
var arrPlyImage =new Array();
var arrPlyName = new Array();
var arrPlyId = new Array();
// increment array
var incrArrPlyImage = 0;


function nextPlayerImage()
{
	// get the first player image control object
	var objPlayer1 = document.getElementById("imgPlayer1");
	var objPlayer2 = document.getElementById("imgPlayer2");
	var objPlayer3 = document.getElementById("imgPlayer3");

	//get the player name control object
	var objName1 = document.getElementById("nameDiv1");
	var objName2 = document.getElementById("nameDiv2");
	var objName3 = document.getElementById("nameDiv3");
	
	//get the player id form a href link
	var objId1 = document.getElementById("playerId1");
	var objId2 = document.getElementById("playerId2");
	var objId3 = document.getElementById("playerId3");
	
	// get the Previous button object
	var objPrevBtn = document.getElementById("btnPreviousPlayerImage");

	// get the Next button object
	var objNextBtn = document.getElementById("btnNextPlayerImage");

	
	
	if ((objPlayer1 != null) && (objPlayer2 != null) && (objPlayer3 != null))
	{
		
		objPlayer1.src = "http://cricworld.shastrasoftech.com/files/players/" + arrPlyImage[3];
		objName1.innerHTML = arrPlyName[3];
		objId1.href = "http://cricworld.shastrasoftech.com/players/details/index/id/" +arrPlyId[3];
		
		objPlayer2.src = "http://cricworld.shastrasoftech.com/files/players/" + arrPlyImage[4];
		objName2.innerHTML = arrPlyName[4];
		objId2.href = "http://cricworld.shastrasoftech.com/details/index/id/" +arrPlyId[4];
		
	}

	// Enable the Previous button control
	if (objPrevBtn != null)
	{
		objPrevBtn.disabled = false;
		objPrevBtn.src="http://cricworld.shastrasoftech.com/images/prev.gif";
	}
	
	// Disable the Next Button control, because displayed last player image
	if (objNextBtn != null)
	{
		objNextBtn.disabled = true;
		objNextBtn.src="http://cricworld.shastrasoftech.com/images/next_disabled.gif";
		//objNextBtn.src="http://localhost/cricworld/public/images/next_disabled.gif";
	}
	
	objPlayer3.style.display = "none";
	objName3.innerHTML = "";
	objId3.href = "";
	
	
	
}

function prevPlayerImage()
{
	// get the first player image control object
	var objPlayer1 = document.getElementById("imgPlayer1");
	var objPlayer2 = document.getElementById("imgPlayer2");
	var objPlayer3 = document.getElementById("imgPlayer3");

	//get the player name control object
	var objName1 = document.getElementById("nameDiv1");
	var objName2 = document.getElementById("nameDiv2");
	var objName3 = document.getElementById("nameDiv3");
	
	//get the player id form a href link
	var objId1 = document.getElementById("playerId1");
	var objId2 = document.getElementById("playerId2");
	var objId3 = document.getElementById("playerId3");
	
	// get the Previous button object
	var objPrevBtn = document.getElementById("btnPreviousPlayerImage");

	// get the Next button object
	var objNextBtn = document.getElementById("btnNextPlayerImage");

	
	
	if ((objPlayer1 != null) && (objPlayer2 != null) && (objPlayer3 != null))
	{
		
		
		objPlayer1.src = "http://cricworld.shastrasoftech.com/files/players/" + arrPlyImage[0];
		objName1.innerHTML = arrPlyName[0];
		objId1.href  = "http://cricworld.shastrasoftech.com/players/details/index/id/" +arrPlyId[0];
		
		objPlayer2.src = "http://cricworld.shastrasoftech.com/files/players/" + arrPlyImage[1];
		objName2.innerHTML = arrPlyName[1];
		objId2.href  = "http://cricworld.shastrasoftech.com/players/details/index/id/" +arrPlyId[1];
		
		// Enable style display property
		objPlayer3.style.display = "";
		objPlayer3.src = "http://cricworld.shastrasoftech.com/files/players/" + arrPlyImage[2];
		objName3.innerHTML = arrPlyName[2];
		objId3.href  = "http://cricworld.shastrasoftech.com/players/details/index/id/" +arrPlyId[2];
	}

	// Enable the Previous button control
	if (objPrevBtn != null)
	{
		objPrevBtn.disabled = true;
		objPrevBtn.src="http://cricworld.shastrasoftech.com/images/prev_disabled.gif";
	}
	
	// Disable the Next Button control, because displayed last player image
	if (objNextBtn != null)
	{
		objNextBtn.disabled = false;
		objNextBtn.src="http://cricworld.shastrasoftech.com/images/next.gif";
		//objNextBtn.src="http://localhost/cricworld/public/images/next_disabled.gif";
	}
	
}

